package com.blb.ioc;

public class ComputerDemo1 {

    public static void main(String[] args) {
        //创建电脑
        Computer computer = new Computer();
        //设置属性
        computer.setBrand("华为");
        //创建配件
        Cpu cpu = new AMDCpu();
        Memory memory = new KingstonMemory();
        computer.setCpu(cpu);
        computer.setMemory(memory);
        //运行
        computer.start();
    }
}
